// 一级路由
import LayOut from '@/views/layout.vue'
// 二级路由
const HomePage = () => import('@/views/seconds/homePage.vue')
const LookForHousing = () => import('@/views/seconds/lookForHousing.vue')
const InForMation = () => import('@/views/seconds/inForMation.vue')
const User = () => import('@/views/seconds/user.vue')

const Login = () => import('@/views/login.vue')
const Register = () => import('@/views/register.vue')
const ListsOfCities = () => import('@/views/listsOfCities.vue')
const MyCollection = () => import('@/views/myCollection.vue')
const MyRental = () => import('@/views/myRental.vue')
const PublishListings = () => import('@/views/publishListings.vue')
const HouseDetails = () => import('@/views/houseDetails.vue')
const FindRoomMap = () => import('@/views/findRoomMap.vue')

const ConTent = () => import('@/views/seconds/conTent.vue')

const routes = [
  {
    path: '/',
    component: LayOut,
    // 重定向
    redirect: '/homePage',
    // 二级路由
    children: [
      {
        path: 'homePage',
        name: 'homePage',
        component: HomePage
      },
      {
        path: 'lookForHousing',
        component: LookForHousing,
        childern: [
          {
            path: 'conTent',
            component: ConTent
          }
        ]
      },
      {
        path: 'inForMation',
        component: InForMation
      },
      {
        path: 'user',
        component: User
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/listsOfCities',
    component: ListsOfCities
  },
  {
    path: '/myCollection',
    component: MyCollection
  },
  {
    path: '/myRental',
    component: MyRental
  },
  {
    path: '/publishListings',
    component: PublishListings
  },
  {
    path: '/houseDetails/:houseCode',
    component: HouseDetails
  },
  {
    path: '/findRoomMap',
    component: FindRoomMap
  }
]

export default routes
